﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using WxPayAPI;

namespace Test.Example
{
    public partial class QRCodeWxPay : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            //Log.Info(this.GetType().ToString(), "page load");

            NativePay nativePay = new NativePay();

            string total_fee = "1";//支付金额  乘100取整了
            string body = body = "微信支付测试-黑皮冬瓜1234";//订单信息
            string orderId = "TDealDbec774ab6821441e8032ae62adcdff5d";//商品ID  订单ID
            string goods_tag = goods_tag = "TDealf1f1473326fb4425be0aef7d1b0fa592,TSuppl5f3996b03592423c946,黑皮冬瓜1234";//商品标签    大订单ID  商家ID  商品名称

            ////生成扫码支付模式二
            string url = nativePay.GetPayUrl(orderId, body, total_fee, goods_tag);
            ////将url生成二维码图片
            Image.ImageUrl = "MakeQRCode.aspx?data=" + HttpUtility.UrlEncode(url);


        }
    }
}